#include <iostream>
#include "chapter15_practice3_exc_mean.h"

void practice_15_3();

//int main()
//{
//	practice_15_3();
//	return 0;
//}

void practice_15_3()
{
	using namespace std;
	double x, y, z;
	cout << "Enter two number: ";
	while (cin >> x >> y)
	{
		try {
			z = practice15_hmean(x, y);
			cout << "Harmonic mean of " << x << " and " << y << " is " << z << endl;
			cout << "Geomettric mean of" << x << " and " << y << " is " << practice15_gmean(x, y) << endl;
			cout << "Enter next set of numbers <q to quit>";
		}
		catch (bad_gmean3 & hg)
		{
			cout << hg.what();
			cout << "Error message:\n";
			hg.mesg();
			cout << endl;
			cout << "Sorry,you don't get to play and more.\n";
			break;
		}
		catch (bad_hmean3 & bg)
		{
			cout << bg.what();
			cout << "Error message:\n";
			bg.mesg();
			cout << endl;
			cout << "Try again.\n";
			continue;
		}
		
	}
	cout << "Bye!\n";
	system("pause");
	return;
}